/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.aksw.treelearning.learner;

import org.aksw.treelearning.data.Cache;
import org.aksw.treelearning.data.Instance;
import org.aksw.treelearning.data.Mapping;
import org.aksw.treelearning.data.MemoryCache;
import org.aksw.treelearning.tree.Condition;

/**
 *
 * @author ngonga
 */
public class ElementaryLearner {
    
    /** 
     * The elementary learner begins by finding the best possible condition for
     * each property via binary search. Then, it simply computes all possible trees
     * that could be generated using this condition and returns the tree with the best 
     * mapping. Note that for n properties, there are 3^n-1 of such tree (we do not 
     * consider the empty tree)
     * @param source
     * @param target 
     */
    public Mapping learn(Cache source, Cache target)
    {
        return new Mapping();
    }
    
    /**
     * 
     * @param source Source cache
     * @param target Target cache
     * @param sourceProperty Property from source cache
     * @param targetProperty Property from target cache
     * @param iterations Number of search iteration
     * @return Best threshold for this particular configuration of a node
     */
    public Condition getBestCondition(Cache source, Cache target, String sourceProperty, String targetProperty, int iterations)
    {
       return new Condition(sourceProperty, 0.5f, 3); 
    }
    
    public Condition getBestCondition(Cache source, Cache target, Condition condition, int iterations)
    {
        return getBestCondition(source, target, condition.sourceProperty, condition.targetProperty, iterations);
    }
    
    
    
}
